/*
 * Singularity Engine
 * Copyright (C) 2010 Vyacheslav Vorobyov, All rights reserved.
 * See LICENSE for full license information.
 */

/**
 * 
 */
package org.singularity.mapred;

import org.singularity.io.DME;

/**
 * This interface specifies a concept of Vectorized Data Modification Event (i.e. VDME). 
 * Actually it is a wrapper for key-value(fact by key) that have been added to or deleted 
 * from underlying Rete of a production system. This abstract necessary for explicit 
 * specification of key part of a fact to be able to join facts in reduce operations.
 * 
 * @author vjache
 *
 * @param <KT> - a type of a key of a key-value pair.
 * @param <VT> - a type of a value of a key-value pair.
 * 
 * @see DME
 */
public interface VDME<KT,VT> extends DME<VT> {
	/**
	 * Returns a key of a key-value pair.
	 */
	KT getKey();
	/**
	 * Returns a value of a key-value pair.
	 */
	@Override
	public VT getValue();
	/**
	 * Puts an annotation info to this VDME. Designed mainly for internal usage.
	 * @param aKey - a key of annotation entry.
	 * @param aValue - an annotation value.
	 */
	void putAnnotation(Object aKey, Object aValue);
	/**
	 * Returns an annotation value by key.
	 * @param aKey - a key of annotation entry.
	 */
	Object getAnnotation(Object aKey);
}
